package www.cslc.com.smokeTest.service;


import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;


public class SmokeRmiUtil {
	private static SmokeRmiUtil instance;
	private IExecuteSmokeTaskService executeSmokeTaskRmiClient;
	@SuppressWarnings("resource")
	public SmokeRmiUtil (){
		String path = System.getProperty("user.dir");  
		ApplicationContext ctx =new FileSystemXmlApplicationContext(path + "\\conf\\applicationContext-ExecuteSmokeTaskRmiClient.xml");  
		executeSmokeTaskRmiClient = (IExecuteSmokeTaskService) ctx.getBean("executeSmokeTaskRmiClient");
	}
	public static  SmokeRmiUtil getInstance() {
		if (instance == null) {
			synchronized(SmokeRmiUtil.class){
				if (instance == null)
				instance = new SmokeRmiUtil();
			}
		}
		return instance;
	}
	
	public String  executeSmokeTask() {
		String str=executeSmokeTaskRmiClient.executeSmokeTask();
		return str;
	}
}
